﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace FileMonitor.Configuration.Prototype
{
    public enum ProcessType
    {
        FTP,
        ExChangeDB
    }
    public class PlantProcessConfiguration
    {
        private ProcessType _processType;
        private string _plantCode;
        private string _dataType;
        private string _dbConnstring;
        private string _ftpPath;
        private string _ftpUsername;
        private string _ftpPassword;
        private string _ftpFolderpath;
        private string _ftpPort;

        public ProcessType ProcessType
        {
            get { return this._processType; }
        }

        public string PlantCode
        {
            get { return this._plantCode; }
        }

        public string DataType
        {
            get { return this._dataType; }
        }

        public string DBConnstring
        {
            get { return this._dbConnstring; }
        }

        public string FTPPath
        {
            get { return this._ftpPath; }
        }

        public string FTPUserName
        {
            get { return this._ftpUsername; }
        }

        public string FTPPasswrod
        {
            get { return this._ftpPassword; }
        }

        public string FTPFolderPath
        {
            get { return this._ftpFolderpath; }
        }

        public int FTPPort
        {
            get
            {
                int iPort = 21;
                Int32.TryParse(this._ftpPort, out iPort);
                return iPort;
            }
        }

        public PlantProcessConfiguration(ProcessType processType, string plantCode, string dataType, string dbConnString,
            string ftpPath, string ftpUserName, string ftpPassword, string ftpFolderPath, string ftpPort)
        {
            this._processType = processType;
            this._plantCode = plantCode;
            this._dataType = dataType;
            this._dbConnstring = dbConnString;
            this._ftpPath = ftpPath;
            this._ftpUsername = ftpUserName;
            this._ftpPassword = ftpPassword;
            this._ftpPort = ftpPort;
        }
    }
}